﻿using System;
using System.Windows.Input;

using MyWindowsMediaPlayer.Models.Library;
using MyWindowsMediaPlayer.Libs.TreeView;
using MyWindowsMediaPlayer.Libs.Mediator;
using MyWindowsMediaPlayer.Libs.ViewModel;

namespace MyWindowsMediaPlayer.ViewModels.Library
{
	class LibrarySubItemViewModel : TreeViewItemViewModel
	{
				# region members

		readonly LibraryModel _item;
		ICommand _selectCommand;
		Mediator _mediator;

		#endregion

		#region Constructor

		public LibrarySubItemViewModel ( LibraryModel item, Mediator mediator )
			: base(null, true)
		{
			this._item = item;
			this._mediator = mediator;
		}

		#endregion

		#region Accessors

		public String Name
		{
			get { return this._item.Name; }
		}

		protected override void LoadChildren ( )
		{
			//foreach (Child in LibraryDatabase.GetChild(this._item)
			//       base.Children.Add)
		}
		
		public ICommand SelectCommand
		{
			get 
			{
				if (this._selectCommand == null)
					this._selectCommand = new RelayCommand(( ) => this.SelectItem());
				return this._selectCommand;
			}
		}

		#endregion

		#region Command

		public void SelectItem ( )
		{

		}

		#endregion
	}
}
